//
//  NSString+OCTool.h
//  OCBase
//
//  Created by Duncan on 2023/6/7.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (OCTool)

- (BOOL)isEmpty;

#pragma mark ------- App信息 -------

/// 比较版本号大小  线上版本号
+ (BOOL)versionCompareWithVersion:(NSString *)version;

/// 获取版本号，比如321
+ (NSString *)getAppVersion;

#pragma mark ------- 手机设备信息 -------

/// 获取屏幕分辨率
+ (NSString *)getPhoneResolution;

/// 获取IDFA
+ (NSString *)getIDFAString;

/// 获取随机生成的UUID
+ (NSString *)getUUIDString;

#pragma mark ------- 工具 -------

/// 查找文本内容里包含的手机号，并将中间四位替换为****
+ (NSString *)getHiddenPhoneNumberContentTextUseString:(NSString *)originContentText;
/// 替换手机号中间四位为****
+ (NSString *)getHiddenPhoneNumberUseString:(NSString *)originPhoneNumber;

// 字符串里超过5位的数字处理
+ (NSString *)getMoreFiveNumberWithContent:(NSString *)content;
/// 保留第一位数字，其他都改为****
+ (NSString *)getHiddenFiveNumberString:(NSString *)originNumbe;


/// 秒转时间  分秒
+ (NSString *_Nullable)convertTimecode:(int64_t)time;
+ (NSString *)getMMSSFromSS:(NSString *)totalTime;

// 当文件名为中文时，解决url编码问题
+ (NSString *)URLDecodedString:(NSString *)str;

/// 判断字符串是否有中文
+ (BOOL)IsChinese:(NSString *)str;

@end

NS_ASSUME_NONNULL_END
